#ifndef XSCRIPTEXECUTOR_H
#define XSCRIPTEXECUTOR_H
#include <vector>
#include <memory>
#include <xscript/xdefs.h>
#include <xscript/xtoken.h>
#include <xscript/xerror.h>
#include <xscript/xvariabletable.h>

class XScriptExecutor : public XError, public std::enable_shared_from_this<XScriptExecutor>, public boost::noncopyable {
  public:
    static std::shared_ptr<XScriptExecutor> getInstance();
    XScriptExecutor();
  public:
    void setTokens(const XTokenBlock& inputToken);
    bool execute();
    std::shared_ptr<XVariableTable> getVariableTable();
  private:
    XTokenBlock tokenBlock;
    std::shared_ptr<XVariableTable> variableTable;
    std::shared_ptr<XAbstractSyntaxTreeBuilder> treeBuilder;
    static std::shared_ptr<XScriptExecutor> executor;
};

#endif // XSCRIPTEXECUTOR_H
